<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue3-escook</title>
  <link rel="stylesheet" href="./lib/style.css">
  <style>
    .outer {
      width: 200px;
      height: 200px;
      background-color: lightgreen;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .inner {
      width: 100px;
      height: 100px;
      background-color: orange;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  </style>
  <script type="importmap">
    {
      "imports" : {
        "vue": "./lib/vue-3.4.29.js"
      }
    }
  </script>
  <script type="module">
    import { createApp } from 'vue'

    const app = createApp({
      setup() {
        return {
        }
      }
    })

    app.mount('#app')
  </script>
</head>

<body>
  <div id="app">
    <a href="https://escook.cn" @click.prevent>老师的博客</a>

    <div class="outer" @click="console.log('outer')">
      <div class="inner" @click="console.log('inner')">
        <!-- <button @click.stop="console.log('btn')">按钮</button> -->
        <!-- 多个事件修饰符可以链式调用，而且一般情况下没有先后顺序 -->
        <a href="https://escook.cn" @click.prevent.stop="console.log('btn')">去老师的博客</a>
      </div>
    </div>
    <hr>

    <div class="outer" @click="console.log('outer')">
      <div class="inner" @click.self.stop="console.log('inner')">
        <button @click.once="console.log('btn')">按钮</button>
      </div>
    </div>
  </div>
</body>

</html>